<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>编辑目录</title>
	<link rel="stylesheet" href="${request.contextPath}/plugins/bootstrap/css/bootstrap.css">
	<link rel="stylesheet" href="${request.contextPath}/plugins/font-awesome/css/font-awesome.min.css"/>
	<link rel="stylesheet" href="${request.contextPath}/plugins/select2/select2.min.css">
	<link rel="stylesheet" href="${request.contextPath}/plugins/iCheck/skins/all.css">
	<link rel="stylesheet" href="${request.contextPath}/plugins/jquery-confirm/jquery-confirm.min.css">
	<link rel="stylesheet" href="${request.contextPath}/hadmin/css/animate.css">
	<link rel="stylesheet" href="${request.contextPath}/hadmin/css/style.css">
	<link rel="stylesheet" href="${request.contextPath}/hadmin/css/common.css">
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox">
					<div class="ibox-content">
						<form class="form-horizontal m-t" id="dirEditForm">
							<input type="hidden" name="id" value="${(sysMenu.id)!}" />
							<div class="form-group">
								<label class="col-sm-2 control-label">目录名称：</label>
								<div class="col-sm-9">
									<input value="${(sysMenu.menuName)!}" type="text" name="menuName" class="form-control" placeholder="请输入目录名称" required>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">目录图标：</label>
								<div class="col-sm-9">
									<span class="form-control">当前图标为：<i id="dirIcon" class="${(sysMenu.icon)!}"></i>
										<a href="javascript:void(0);" onclick="selectIcon(1)" class="pull-right">
											 点击选取图标
										</a>
									</span>
									<input type="hidden" class="form-control"  name="icon"  id="folderIcon" value="${(sysMenu.icon)!}">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">目录排序：</label>
								<div class="col-sm-9">
									<input value="${(sysMenu.sort)!}" type="text" name="sort" class="form-control" placeholder="请输入目录排序" required>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- 通用js引入 -->
	<script src="${request.contextPath}/plugins/jQuery/jQuery-2.1.4.min.js"></script>
	<script src="${request.contextPath}/plugins/bootstrap/js/bootstrap.min.js"></script>
	<script src="${request.contextPath}/plugins/select2/select2.full.min.js"></script>
	<script src="${request.contextPath}/plugins/iCheck/icheck.min.js"></script>
	<script src="${request.contextPath}/plugins/layer/layer.min.js"></script>
	<script src="${request.contextPath}/plugins/laydate/laydate.js"></script>
	<script src="${request.contextPath}/plugins/jquery.cookie.js"></script>
	<script src="${request.contextPath}/plugins/jquery-confirm/jquery-confirm.min.js"></script>
	<script src="${request.contextPath}/plugins/validate/jquery.validate.min.js"></script>
	<script src="${request.contextPath}/plugins/validate/messages_zh.min.js"></script>
	<script src="${request.contextPath}/plugins/blockUI/jquery.blockUI.js"></script>
	<script src="${request.contextPath}/hadmin/js/content.js"></script>
	<script src="${request.contextPath}/hadmin/js/common.js?v=0.9"></script>
	<script>
		// 选取图标
		function selectIcon(type) {
			var layerIndex = parent.layer.getFrameIndex(window.name);
			parent.layer.open({
				type : 2,
				title : '选取图标',
				closeBtn : 1,
				anim : -1,
				isOutAnim : false,
				shadeClose : false,
				shade : 0.3,
				area : [ '90%', '90%' ],
				content : '${request.contextPath}/system/sysmenu/icon',
				btn : [ '确定', '取消' ],
				yes : function(index, layero) {
					var iframeWin = layero.find('iframe')[0];
					iframeWin.contentWindow.submitHandler(index,layero);
				},
				success : function(layero, index) {
					var body = parent.layer.getChildFrame('body', index);
					body.find("#sid").attr("iconType", type + "," + layerIndex);
				}
			});
		}
		// 提交保存
		function submitHandler() {
			if ($("#dirEditForm").validate().form()) {
				saveInfo('${request.contextPath}/system/sysmenu/doEdit', $('#dirEditForm').serialize());
			}
		}
	</script>
</body>
</html>
